﻿@{
    Layout = null;
    List<vw08_equest.Models.Exam> ExamList = ViewBag.ExamList as List<vw08_equest.Models.Exam>;
}

<!DOCTYPE html>

<html>
    <head>
        <title>Login</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <link href="Content/style.css" rel="stylesheet" type="text/css" />
    	<script src="Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
        <script src="../../Scripts/jquery.form.js" type="text/javascript"></script>
        <script src="../../Scripts/General.js" type="text/javascript"></script>
        <script type="text/javascript">
            function RedirectToHome() {
                var link = '/admin';
                window.location.replace(link);
            }
        </script>
    </head>
    <body class="loginbg">
        <div id="wrap">
            <form method="post" action="login.php">
                <div class="logindivwrap">
                    <div class="logindivtitle">
                        <img src="../../Content/equest_logo.png" />
                    </div>
                    <div class="logindiv">
                        <div id="message" class="loginmargintop" style="float:left; margin-left:30px">
                            
                        </div>
                        <div class="clear">&nbsp;</div>
                        <div class="loginatributelabel">Họ tên:</div>
                        <div class="loginatributeeditor"><input type="text" class="input250" name="StudentName" id="StudentName"/></div>
                        <div class="clear">&nbsp;</div>
                        <div class="loginatributelabel">Số điện thoại:</div>
                        <div class="loginatributeeditor"><input type="text" class="input250" name="Phone" id="Phone"/></div>
                        <div class="clear">&nbsp;</div>
                        <div class="loginatributelabel">Email:</div>
                        <div class="loginatributeeditor"><input type="text" class="input250" name="Email" id="Email"/></div>
                        <div class="clear">&nbsp;</div>
                        <div class="loginatributelabel">Chọn đợt thi:</div>
                        <div class="loginatributeeditor">
                        @Html.DropDownList("ExamID",
                            new SelectList(ExamList, "ExamID", "ExamName"), new { style = "width:255px" }
                        )
                        </div>
                        <div class="clear">&nbsp;</div>
                        <div class="loginatributelabel"></div>
                        <div class="loginatributeeditor"><input type="checkbox" id="NoiQuy" name="NoiQuy"/> Tôi đã đọc <a href="#" target="_blank">nội quy thi</a></div>
                        <div class="clear">&nbsp;</div>
                        <div class="loginatributelabel">&nbsp;</div>
                        <div class="loginatributeeditor">
                            <input type="submit" value="Đăng ký thi" onclick="return checkForm();"/>&nbsp;&nbsp;&nbsp;
                        </div>
                        <div class="clear">&nbsp;</div>
                    </div>
                    <div style="text-align:center;color:#848484;margin-top:10px">Copyright © 2013 EQuest Academy. All rights reserved</div>
                </div>
            </form>
            <script>
                function checkForm() {
                    if (CheckBlank(document.getElementById('StudentName').value)) {
                        document.getElementById("message").innerHTML = "<div class=\"error-msg\">Bạn chưa nhập họ tên</div>";
                        document.getElementById('StudentName').focus();
                        return false;
                    }
                    if (CheckBlank(document.getElementById('Email').value)) {
                        document.getElementById("message").innerHTML = "<div class=\"error-msg\">Bạn chưa nhập Email</div>";
                        document.getElementById('Email').focus();
                        return false;
                    }
                    if (!CheckEmail_new(document.getElementById('Email').value)) {
                        document.getElementById("message").innerHTML = "<div class=\"error-msg\">Email không hợp lệ</div>";
                        document.getElementById('Email').focus();
                        return false;
                    }
                    if (CheckBlank(document.getElementById('Phone').value)) {
                        document.getElementById("message").innerHTML = "<div class=\"error-msg\">Bạn chưa nhập số điện thoại</div>";
                        document.getElementById('Phone').focus();
                        return false;
                    }
                    if (document.getElementById('NoiQuy').checked == false) {
                        document.getElementById("message").innerHTML = "<div class=\"error-msg\">Bạn chưa phải đọc nội quy thi</div>";
                        document.getElementById('NoiQuy').focus();
                        return false;
                    }
                }
            </script>
        </div>
    </body>
</html>
